local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system({
        "git", "clone", "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release
        lazypath
    })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
    {
        'nvim-telescope/telescope.nvim',
        tag = '0.1.5',
        dependencies = {'nvim-lua/plenary.nvim'}
    }, {'cooperuser/glowbeam.nvim'}, {'joshdick/onedark.vim'},
    -- {'rebelot/kanagawa.nvim'},
    {'EdenEast/nightfox.nvim'}, {'nvim-treesitter/nvim-treesitter'},
    {'neovim/nvim-lspconfig'}, {'hrsh7th/cmp-nvim-lsp'}, {'hrsh7th/cmp-buffer'},
    {'hrsh7th/cmp-path'}, {'hrsh7th/cmp-cmdline'}, {'hrsh7th/nvim-cmp'},
    {'lewis6991/gitsigns.nvim'}, {
        'nvim-lualine/lualine.nvim',
        dependencies = {
            'nvim-tree/nvim-web-devicons', 'linrongbin16/lsp-progress.nvim'
        }
    }, {'nvim-tree/nvim-web-devicons'},
    {"williamboman/mason.nvim", build = ":MasonUpdate"},
    {'akinsho/toggleterm.nvim', version = "*", config = true},
    {'jose-elias-alvarez/null-ls.nvim'}, {'windwp/nvim-autopairs'},
    {'Djancyp/outline'}, {'terrortylor/nvim-comment'},
    {'windwp/nvim-ts-autotag'}, {
        "nvim-neo-tree/neo-tree.nvim",
        branch = "v2.x",
        dependencies = {
            "nvim-lua/plenary.nvim", "nvim-tree/nvim-web-devicons",
            "MunifTanjim/nui.nvim", "s1n7ax/nvim-window-picker"
        }
    },
    {"akinsho/bufferline.nvim", dependencies = {'nvim-tree/nvim-web-devicons'}},
    {'hrsh7th/cmp-nvim-lsp-signature-help'}, {
        'linrongbin16/lsp-progress.nvim',
        event = {'VimEnter'},
        dependencies = {'nvim-tree/nvim-web-devicons'},
        config = function() require('lsp-progress').setup() end
    }, {
        'glepnir/dashboard-nvim',
        event = 'VimEnter',
        dependencies = {{'nvim-tree/nvim-web-devicons'}}
    }, {"folke/which-key.nvim"}, {'hrsh7th/vim-vsnip'},
    {'hrsh7th/vim-vsnip-integ'}, {'f-person/git-blame.nvim'},
    {'tpope/vim-fugitive'}, {
        "smoka7/multicursors.nvim",
        event = "VeryLazy",
        dependencies = {'smoka7/hydra.nvim'},
        opts = {},
        cmd = {
            'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern',
            'MCunderCursor'
        },
        keys = {
            {
                mode = {'v', 'n'},
                '<Leader>zm',
                '<cmd>MCunderCursor<cr>',
                desc = 'Multicursor mode'
            }
        }
    }, {'airblade/vim-gitgutter'}, {
        "folke/flash.nvim",
        event = "VeryLazy",
        ---@type Flash.Config
        opts = {},
        keys = {
            {
                "s",
                mode = {"n", "x", "o"},
                function()
                    require("flash").jump({
                        search = {mode = function(str)
                            return "\\<" .. str
                        end}
                    })
                end,
                desc = "Flash"
            }, {
                "S",
                mode = {"n", "o", "x"},
                function() require("flash").treesitter() end,
                desc = "Flash Treesitter"
            }, {
                "r",
                mode = "o",
                function() require("flash").remote() end,
                desc = "Remote Flash"
            }, {
                "R",
                mode = {"o", "x"},
                function() require("flash").treesitter_search() end,
                desc = "Flash Treesitter Search"
            }, {
                "<c-s>",
                mode = {"c"},
                function() require("flash").toggle() end,
                desc = "Toggle Flash Search"
            }
        }
    }
});
